import {createDrawerNavigator} from "@react-navigation/drawer";
import {HomeScreen} from "../screens/HomeScreen";
import {DrawerMenu} from "../components/DrawerMenu";
import {createStackNavigator} from "@react-navigation/stack";
import {AboutScreen} from "../screens/AboutScreen";
import {Product} from "../types/Product";
import BasketScreen from "../screens/BasketScreen";
import LocationScreen from "../screens/LocationScreen";
import ProfileScreen from "../screens/ProfileScreen";
import {StackHeader} from "../components/StackHeader";

export type MainStackParamList = {
    HomeScreen: any,
    BasketScreen: any,
    LocationScreen: any,
    ProfileScreen: any,
    AboutScreen: Product,
}

const Drawer = createDrawerNavigator<MainStackParamList>();
const Stack = createStackNavigator<MainStackParamList>();
export const MainStack = () => {

    return (
        <Drawer.Navigator drawerContent={DrawerMenu}
                          initialRouteName={"HomeScreen"}
                          screenOptions={{
                              // header: DrawerHeader,
                              drawerStatusBarAnimation: "fade",
                              drawerStyle: {
                                  width: 200
                              },
                              drawerType: "front",
                              swipeEdgeWidth: 66,
                          }}>
            <Drawer.Screen name={"HomeScreen"}
                           options={{
                               headerShown: false,
                           }}
                           component={HomeScreen}/>

            <Drawer.Screen name={"ProfileScreen"}
                           component={ProfileScreen}/>

            <Drawer.Screen name={"BasketScreen"}
                           component={BasketScreen}/>

            <Drawer.Screen name={"LocationScreen"}
                           component={LocationScreen}/>

            <Drawer.Group navigationKey={`StackGroup`}
                          screenOptions={{
                              swipeEnabled: false,
                              header: StackHeader,
                              // headerTransparent: true,
                              // headerShadowVisible: false,
                              headerTitle: `Вернуться в каталог`
                          }}>
                <Stack.Screen name={"AboutScreen"}
                              component={AboutScreen}/>

            </Drawer.Group>

        </Drawer.Navigator>
    );
};